﻿using System.IO;

namespace Jerry.DroidBuilder
{
    public class TextEditorViewModel : ViewModelBase
    {
        public TextEditorViewModel(string fileName)
        {
            FileName = fileName;
            TextFormat = Path.GetExtension(fileName);
            Text = File.ReadAllText(fileName);
        }

        /// <summary>
        /// Gets or sets the text of the editor.
        /// </summary>
        public string Text { get; set; }

        /// <summary>
        /// Gets or sets the file name currently editing.
        /// </summary>
        public string FileName { get; private set; }

        /// <summary>
        /// Gets or sets text format.
        /// </summary>
        public string TextFormat { get; private set; }
    }
}
